
	<link rel="stylesheet" href="/css/style_tabs.css" type="text/css" media="screen">
    <script src="/js/jquery-1.js"></script>
    <script>
        common.setMainTitle('Cấu hình hệ thống');
	  // When the document loads do everything inside here ...
	  $(document).ready(function(){		
		// When a link is clicked
		$("a.tab").click(function () {
			// switch all tabs off
			$(".active").removeClass("active");
			// switch this tab on
			$(this).addClass("active");
			// slide all content up
			//$(".content").slideUp();
			
			// slide this content up
			//var content_show = $(this).attr("title");
			//$("#"+content_show).slideDown();
		});
	
	  });
        function disableAllTab(){
            document.getElementById('content_1').style.display='none';
            document.getElementById('content_2').style.display='none';
            document.getElementById('content_3').style.display='none';
            document.getElementById('content_4').style.display='none';
        }
  </script>

<div id="tabbed_box_1" class="tabbed_box">
    <div class="tabbed_area">    	
        <ul class="tabs">
            <li><a onclick="disableAllTab();document.getElementById('content_1').style.display='block';" title="content_1" class="tab active">Thông tin chung</a></li>
            <li><a onclick="disableAllTab();document.getElementById('content_2').style.display='block';" title="content_2" class="tab">Email</a></li>
            <li><a onclick="disableAllTab();document.getElementById('content_3').style.display='block';" title="content_3" class="tab">Liên hệ</a></li>
            <li><a onclick="disableAllTab();document.getElementById('content_4').style.display='block';" title="content_4" class="tab">Support Yahoo</a></li>
        </ul>
        
            <div style="display: block;" id="content_1" class="content">
			<?php 
                $info = config::get('info');
				$page = config::get('page');
            ?>
            <fieldset>
            <form name="frmConfigThongTinChung" action="/admin/config/saveconfigttchung" method="POST">
        	<ul>
            	<li><div class="title">Name:</div>
						<input type="text" name="infoname" id="" value="<?=$info['name']?>"/>           	
            	</li>
				<li><div class="title">Email name:</div>
							<input type="text" name="infoaddress" id="" value="<?=$info['address']?>"/>           	
            	</li>
				<li><div class="title">Page Tittle:</div>
						<input type="text" name="infopageTitle" id="" value="<?=$info['pageTitle']?>"/>           	
            	</li>
				<li><div class="title">Page Limit:</div>
						<input type="text" name="pageLimit" id="" value="<?=$page['limit']?>"/>           	
            	</li>
				<li><div class="title">Page Offset:</div>
						<input type="text" name="pageOffset" id="" value="<?=$page['offset']?>"/>           	
            	</li>
				<li style="height:60px">
					<div class="actionContent">
					<div id="buttonMuonTra" class='button-save-config' onclick="submitConfigTtchung()">
					</div>
					<div id="messageTtchung" class='button-save-message'>
					bạn đã lưu thành công
					</div>
					</div>
				</li>
			</ul>
            </form>
            </fieldset>
        </div>
        <!-- locate REGION_templateController| -->
        <div style="display: none;" id="content_2" class="content">
            <div id="controllers">
				<?php 
                $email = config::get('email');
				?>
                <fieldset>
                    <form name="frmConfigEmail" action="/admin/config/saveconfigemail" method="POST">   
                    <ul>
                        <li><div class="title">ssl :</div>
							<input type="text" name="ssl" id="" value="<?=$email['ssl']?>" />
                        </li>  
                        <li><div class="title">port :</div>
							<input type="text" name="port" id="" value="<?=$email['port']?>" />
                        </li>        
                         <li><div class="title">Auth :</div>
							<input type="text" name="auth" id="" value="<?=$email['auth']?>" />
                        </li>   
                        <li><div class="title">Host :</div>
							<input type="text" name="host" id="" value="<?=$email['host']?>" />
                        </li>  
                        <li><div class="title">Lang :</div>
							<input type="text" name="lang" id="" value="<?=$email['lang']?>" />
                        </li>  	
                        <li><div class="title">Username :</div>
							<input type="text" name="username" id="" value="<?=$email['username']?>" />
                        </li>
						<li><div class="title">Password :</div>
							<input type="text" name="password" id="" value="<?=$email['password']?>" />
                        </li>
                        <li><div class="title">From :</div>
							<input type="text" name="from" id="" value="<?=$email['from']?>" />
                        </li>
                        <li><div class="title">Alias From :</div>
							<input type="text" name="alias" id="" value="<?=$email['aliasfrom']?>" />
                        </li>
                        <li><div class="title">Title Email :</div>
							<input type="text" name="title" id="" value="<?=$email['title']?>"/>
                        </li>
						<li><div class="title">Dir Upload :</div>
							<input type="text" name="dirupload" id="" value="<?=$email['dirupload']?>"/>
                        </li>
                        <li style="height:60px">
                            <div class="actionContent">
                            <div id="buttonEmail" class='button-save-config' onclick="submitConfigEmail()">
                            </div>
                            <div id="messageEmail" class='button-save-message'>
                            Bạn đã lưu thành công
                            </div>
                            </div>
                        </li>
                    </ul>                    
                    </form>
                </fieldset>
            </div>            
        </div>
        <div style="display: none;" id="content_3" class="content">
			<?php 
                $contact = config::get('contact');
			?>
            <fieldset>
                <form name="frmConfigContact" action="/admin/config/saveconfigcontact" method="POST">
                    <ul>
                        <li><div class="title">Trụ sở chính : </div>
							<input type="text" name="nameshop" id="" value="<?=$contact['nameshop']?>"/>
                        </li>
                        <li><div class="title">Địa chỉ:</div>
							<input type="text" name="address" id="" value="<?=$contact['address']?>"/>
                        </li>
                        <li><div class="title">Thành phố:</div> 
							<input type="text" name="city" id="" value="<?=$contact['city']?>"/>
                        </li>
						<li><div class="title">Điện thoại:</div>
							<input type="text" name="phone" id="" value="<?=$contact['phone']?>"/>
                        </li>
						<li><div class="title">Email:</div> 
							<input type="text" name="email" id="" value="<?=$contact['email']?>"/>
                        </li>
						<li><div class="title">Tài khoản ủng hộ :</div>
							<input type="text" name="card" id="" value="<?=$contact['card']?>"/>
                        </li>                        
						<li style="height:60px">
                            <div class="actionContent">
                            <div id="buttonContact" class='button-save-config' onclick="submitConfigContact()">
                            </div>
                            <div id="messageContact" class='button-save-message'>
                            Bạn đã lưu thành công
                            </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </fieldset>
        </div>
        
        <div style="display: none;" id="content_4" class="content">
			<?php 
                $support = config::get('support');
			?>
            <fieldset>
                <form name="frmConfigSupport" action="/admin/config/saveconfigsupport" method="POST">
                    <ul>
                     	<li><div class="title">Tên Yahoo 1</div>
							<input type="text" name="titleyahoo1" id="" value="<?=$support['titleyahoo1']?>"/>
                        </li>
                        <li><div class="title">Yahoo Id 1</div>
							<input type="text" name="yahoo1" id="" value="<?=$support['yahoo1']?>"/>
                        </li>
                       
                       <li><div class="title">Tên Yahoo 2</div>
							<input type="text" name="titleyahoo2" id="" value="<?=$support['titleyahoo2']?>"/>
                        </li>
                        <li><div class="title">Yahoo Id 2</div>
							<input type="text" name="yahoo2" id="" value="<?=$support['yahoo2']?>"/>
                        </li>
                       
                        <li><div class="title">Tên Yahoo 3</div>
							<input type="text" name="titleyahoo3" id="" value="<?=$support['titleyahoo3']?>"/>
                        </li>
                        <li><div class="title">Yahoo Id 3</div> 
							<input type="text" name="yahoo3" id="" value="<?=$support['yahoo3']?>"/>
                        </li>
 						
 						<li><div class="title">Tên Yahoo 4</div>
							<input type="text" name="titleyahoo4" id="" value="<?=$support['titleyahoo4']?>"/>
                        </li>
						<li><div class="title">Yahoo Id 4</div>
							<input type="text" name="yahoo4" id="" value="<?=$support['yahoo4']?>"/>
                        </li>
                       
						<li style="height:60px">
                            <div class="actionContent">
                            <div id="buttonSupport" class='button-save-config' onclick="submitConfigSupport()">
                            </div>
                            <div id="messageSupport" class='button-save-message'>
                            	Bạn đã lưu thành công
                            </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </fieldset>
        </div>
        
    </div>
</div>
<script> 
	function submitConfigTtchung(){
        if(window.result === undefined || window.result === null){
            common.submitForm(document.frmConfigThongTinChung,'submitConfigTtchung');
        }else{
            if(result === '1'){
                window.result = null;
                faceIn('messageTtchung');
                setTimeout("faceOut('messageTtchung')",2000);
            }
        }
    }
    
	function submitConfigEmail(){
        if(window.result === undefined || window.result === null){
            common.submitForm(document.frmConfigEmail,'submitConfigEmail');
        }else{
            if(result === '1'){
                window.result = null;
                faceIn('messageEmail');
                setTimeout("faceOut('messageEmail')",2000);
            }
        }
    }
	
	function submitConfigContact(){
        if(window.result === undefined || window.result === null){
            common.submitForm(document.frmConfigContact,'submitConfigContact');
        }else{
            if(result === '1'){
                window.result = null;
                faceIn('messageContact');
                setTimeout("faceOut('messageContact')",2000);
            }
        }
    }
	function submitConfigSupport(){
        if(window.result === undefined || window.result === null){
            common.submitForm(document.frmConfigSupport,'submitConfigSupport');
        }else{
            if(result === '1'){
                window.result = null;
                faceIn('messageSupport');
                setTimeout("faceOut('messageSupport')",2000);
            }
        }
    }
    
    // dưới đây tái sử dụng cho các config khác
    function faceIn(id){
        $('#'+id).fadeIn('slow', function() {
        });
    }
    function faceOut(id){
        $('#'+id).fadeOut('slow', function() {
        })
    }
</script>